package com.zx._09_架构.load_balance;

import java.util.List;

public class LB2_轮询 {

    /**
     * 【常规可用】轮询算法
     *
     * @param args
     */
    public static void main(String[] args) {
        List<String> servers = LB0_common.getServers();

        int size = servers.size();
        int idx = 0;
        for (int i = 0; i < 1000; i++) {
            LB0_common.saveResult(servers.get(idx));
            idx++;
            if (idx == size) {
                idx = 0;
            }
        }

        LB0_common.printResultAndClear();
    }
}
